/**
  ETFRoot project, Anyang Normal University && IMP-CAS
  \class ETFMsg
  \brief to print runtime message
  \author SUN Yazhou, asia.rabbit@163.com
  \since 2021-10-03
  \date 2021-10-03 last modified
  \attention
  changelog
  <table>
  <tr>  <th>Date         <th>Author      <th>Description                    </tr>
  <tr>  <td>2021-10-03   <td>Asia Sun    <td>file created                   </tr>
  </table>

  \copyright Copyright (c) 2021 Anyang Normal U. && IMP-CAS with LGPLv3 LICENSE
*/

#ifndef ETFMsg_h
#define ETFMsg_h

#include <Rtypes.h>

class ETFMsg{
public:
	ETFMsg(){};
	~ETFMsg(){};
	static void Info(const char *cname, const char *fmt, ...);
	static void Error(const char *cname, const char *fmt, ...);
	static void Warn(const char *cname, const char *fmt, ...);
	static void Debug(const char *cname, const char *fmt, ...);
	static void ConfigInfo(const char *cname, const char *fmt, ...);
	static void ShowPoint(const char *msg, const double *p, const int len = 3);
	static void Logo(); // ETFROOT Logo

	static void SetVerbose(bool opt = true){ fIsVerbose = opt; }
	static void SetSilent(bool opt = true){ fIsSilent = opt; }
	static void SetDebug(bool opt = true){ fIsDebug = opt; }
	static bool IsVerbose(){ return fIsVerbose; }
	static bool IsSilent(){ return fIsSilent; }
	static bool IsDebug(){ return fIsDebug; }

	/// \param isName (true): no comma in the returned string, suitable for path and file name
	static const char *time0(bool isName = false); ///< current time year-month-day_hour-Min

	ClassDef(ETFMsg, 0); // ETFRoot messaging system

protected:
	static bool fIsVerbose; ///< to switch On ConfigInfo() method
	static bool fIsSilent; ///< to switch off Info() method
	static bool fIsDebug; ///< to switch On Debug() method
};

#endif
